<template>
  <div>
      <input
        id="file"
        type="file"
        v-show="show"
        @change="changeFile"
      >
      <button @click="open"><slot name="but" :row='str'/></button>
      <ul v-if="list.length > 0">1
          <li v-for="item in list" :key="item.lastModified">
              <span>{{item.name}}</span>
          </li>
      </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      list: [],
      str: {a: 1}
    }
  },
  computed: {
    img() {
      return this.list
    }
  },
  methods: {
    open() {
      let file = document.getElementById("file")
      file.click()
    },
    changeFile(e) {
      this.$emit("file",e.target.files,this.list)
    }
  }
}
</script>

<style>

</style>